#pragma once

class Vector{
private:
	static const int SOMETHING_THAT_SOUNDS_GOOD = 5;
	int * m_array;
	int m_allocated, m_size;
public:
	Vector():m_array(0),m_allocated(0),m_size(0){}
	int size(){return m_size;}
	void setSize(const int & a_size){m_size=a_size;}
	int get(int a_index){return m_array[a_index];}
	void add(const int & a_value){
		if(!m_array)
			m_array = new int[(m_allocated = SOMETHING_THAT_SOUNDS_GOOD)];
		if(m_size >= m_allocated){
			int newSize = m_allocated + SOMETHING_THAT_SOUNDS_GOOD;
			int * newArray = new int [newSize];
			for(int i = 0; i < m_size; ++i)
				newArray[i] = m_array[i];
			delete m_array;
			m_array = newArray;
			m_allocated = newSize;
		}
		m_array[m_size++] = a_value;
	}
	~Vector(){delete m_array;}
};
